#coding:utf8
'''
author:Cooper
date:2012.5.21
'''

import requests

def getRes(api,format='json',**params):
	url=api+'.'+format+'?'+'&'.join([k+'='+str(v) for k,v in params.items()])
	r=None
	for i in range(3):
		try:
			r=requests.request('GET',url)
			t=r.content
			break
		except Exception as e:
			print e
	return r

def main():
	pass

if __name__ == '__main__':
	main()